Last Update: 2025/3/26
SenseFlow Conversation API
The SenseFlow Conversation API allows you manage your conversations.
Endpoints
Delete Conversation
DELETE https://platform.llmprovider.ai/v1/agent/conversations/{conversation_id}
Delete a conversation and all its messages.
Request Headers
Header | Value |
---|---|
Authorization | Bearer YOUR_API_KEY |
Content-Type | application/json |
Request Body
Parameter | Type | Description |
---|---|---|
user | string | End user identifier |
model | string | agent name |
Example Request
- Shell
- Python
- Node.js
curl -X DELETE 'https://platform.llmprovider.ai/v1/agent/conversations/conv_12345' \
--header 'Authorization: Bearer $YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "",
"user": "abc-123"
}'
import requests
api_key = 'YOUR_API_KEY'
url = 'https://platform.llmprovider.ai/v1/agent/conversations/conv_12345'
headers = {
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
}
data = {
'model': '',
'user': 'abc-123'
}
response = requests.delete(url, headers=headers, json=data)
print(response.json())
const axios = require('axios');
const apiKey = 'YOUR_API_KEY';
const url = 'https://platform.llmprovider.ai/v1/agent/conversations/conv_12345';
const data = {
model: '',
user: 'abc-123'
};
const headers = {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
};
axios.delete(url, {headers, data})
.then(response => console.log(response.data))
.catch(error => console.error(error));
Response
{
"result": "success"
}
Get Conversations
GET https://platform.llmprovider.ai/v1/agent/conversations
Retrieve a list of conversations for the current user.
Request Headers
Header | Value |
---|---|
Authorization | Bearer YOUR_API_KEY |
Query Parameters
Parameter | Type | Description |
---|---|---|
model | string | agent name |
user | string | End user identifier |
last_id | string | (Optional) Last conversation ID of current page |
limit | int | (Optional) Number of conversations to return (default 20) |
sort_by | string | (Optional) Sort field, default -updated_at. Options: created_at, -created_at, updated_at, -updated_at |
Response
Field | Type | Description |
---|---|---|
data | array[Conversation] | Array of conversation objects |
has_more | boolean | Whether more conversations exist |
limit | integer | Number of conversations returned |
Conversation Object
Field | Type | Description |
---|---|---|
id | string | Conversation ID |
name | string | Conversation name |
inputs | object | User input parameters |
status | string | Conversation status |
introduction | string | Opening statement |
created_at | integer | Creation timestamp |
updated_at | integer | Last update timestamp |
Example Request
- Shell
- Python
- Node.js
curl -X GET 'https://platform.llmprovider.ai/v1/agent/conversations?model=&user=abc-123&last_id=&limit=20' \
--header 'Authorization: Bearer $YOUR_API_KEY'
import requests
api_key = 'YOUR_API_KEY'
url = 'https://platform.llmprovider.ai/v1/agent/conversations'
headers = {
'Authorization': f'Bearer {api_key}'
}
params = {
'model': '',
'user': 'abc-123',
'last_id': '',
'limit': 20
}
response = requests.get(url, headers=headers, params=params)
print(response.json())
const axios = require('axios');
const apiKey = 'YOUR_API_KEY';
const url = 'https://platform.llmprovider.ai/v1/agent/conversations';
const params = {
model: '',
user: 'abc-123',
last_id: '',
limit: 20
};
const headers = {
'Authorization': `Bearer ${apiKey}`
};
axios.get(url, {headers, params})
.then(response => console.log(response.data))
.catch(error => console.error(error));
Example Response
{
"limit": 20,
"has_more": false,
"data": [
{
"id": "10799fb8-64f7-4296-bbf7-b42bfbe0ae54",
"name": "New chat",
"inputs": {
"book": "book",
"myName": "Lucy"
},
"status": "normal",
"introduction": "",
"created_at": 1679667915,
"updated_at": 1679667915
}
]
}
Rename Conversation
POST https://platform.llmprovider.ai/v1/agent/conversations/{conversation_id}/name
Rename a conversation or generate a name automatically.
Request Headers
Header | Value |
---|---|
Authorization | Bearer YOUR_API_KEY |
Content-Type | application/json |
Path Parameters
Parameter | Type | Description |
---|---|---|
conversation_id | string | Conversation ID |
Request Body
Parameter | Type | Description |
---|---|---|
model | string | agent name |
name | string | (Optional) New conversation name |
auto_generate | boolean | (Optional) Auto-generate name, default false |
user | string | End user identifier |
Response
Field | Type | Description |
---|---|---|
id | string | Conversation ID |
name | string | Updated conversation name |
inputs | object | User input parameters |
status | string | Conversation status |
introduction | string | Opening statement |
created_at | integer | Creation timestamp |
updated_at | integer | Last update timestamp |
Example Request
- Shell
- Python
- Node.js
curl -X POST 'https://platform.llmprovider.ai/v1/agent/conversations/conv_12345/name' \
--header 'Authorization: Bearer $YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data-raw '{
"model": "",
"name": "Discussion about AI",
"auto_generate": false,
"user": "abc-123"
}'
import requests
api_key = 'YOUR_API_KEY'
url = 'https://platform.llmprovider.ai/v1/agent/conversations/conv_12345/name'
headers = {
'Authorization': f'Bearer {api_key}',
'Content-Type': 'application/json'
}
data = {
'model': '',
'name': 'Discussion about AI',
'auto_generate': False,
'user': 'abc-123'
}
response = requests.post(url, headers=headers, json=data)
print(response.json())
const axios = require('axios');
const apiKey = 'YOUR_API_KEY';
const url = 'https://platform.llmprovider.ai/v1/agent/conversations/conv_12345/name';
const data = {
model: '',
name: 'Discussion about AI',
auto_generate: false,
user: 'abc-123'
};
const headers = {
'Authorization': `Bearer ${apiKey}`,
'Content-Type': 'application/json'
};
axios.post(url, data, {headers})
.then(response => console.log(response.data))
.catch(error => console.error(error));
Example Response
{
"id": "34d511d5-56de-4f16-a997-57b379508443",
"name": "Discussion about AI",
"inputs": {},
"status": "normal",
"introduction": "",
"created_at": 1732731141,
"updated_at": 1732734510
}